https://github.com/cocos-creator/engine/blob/314ede133/cocos/spine/skeleton.ts#L206
/**
* @en The name of current playing animation.
* @zh 当前播放的动画名称。
* @property {String} animation
*/
get animation (): string {
if (this.isAnimationCached()) {
return this._animationName;
}
const entry = this.getCurrent(0);
return (entry && entry.animation.name) || '';
}
set animation (value: string) {
if (value) {
this.setAnimation(0, value, this.loop);
this.destroyRenderData();
this.markForUpdateRenderData();
} else if (!this.isAnimationCached()) {
this.clearTrack(0);
this.setToSetupPose();
}
}
|